import React from 'react';
import { connect } from 'react-redux';

import MyRoute from './router';
import Tabbar from './components/Tabbar';
import './css/index.css';

const Child = (props) => {
  const { showBar } = props;
  return (
    <>
      {/* 其他内容 */}
      <MyRoute>{showBar && <Tabbar></Tabbar>}</MyRoute>
    </>
  );
};

const MapStateToPropsParam = (state) => {
  return {
    showBar: state.TabbarReducer.showBar,
  };
};

export default connect(MapStateToPropsParam)(Child);
